<?php
/*
 * This file contains all the constant used in the whole project
 *
 * @author jszhang
 */

//constant example
define( 'COMMENT_PER_PAGE', 10 );
define( 'SHOP_INFO_PER_PAGE', 10 );
define( 'LIST_INFO_PER_PAGE', 10 );
define( 'PRODUCT_INFO_PER_PAGE', 10 );
define(	'RESPONSE_PER_PAGE', 10);
define( 'USER_INFO_PER_PAGE', 20 );
define( 'REVIEW_PER_PAGE', 10 );
define(	'COUPON_PER_PAGE', 12 );
define( 'TOP_PER_PAGE', 20 );
define( 'SEARCH_SUGGESTION_PAGE', 8 );

//user auth related constant

define( 'COOKIE_DOMAIN', '.huakaili.com' );

//Cookie Parameter Name
define( 'CP_AUTH_TOKEN', 'huakaili' );


//Url parameter name
define('UP_SEARCH_KEY','q');
define('UP_SEARCH_KIND','t');
define('UP_RESULT_PAGE','p');



// Physical file path definition

define( 'ROOT_DIR', dirname( dirname(__FILE__) ).'/');
define( 'STATIC_DIR',ROOT_DIR.'static/');
define( 'LIB_DIR',ROOT_DIR.'lib/');
define( 'FUNCTIONS_DIR', LIB_DIR . 'functions/');
define( 'CONFIG_DIR', ROOT_DIR.'config/');
define( 'CLASSES_DIR', LIB_DIR . 'classes/');
define( 'MODEL_DIR', LIB_DIR . 'model/' );
define( 'EMAIL_DIR', STATIC_DIR.'email/');
define( 'PAGE_NOT_FOUND', 'page_not_found' );
define( 'DIR_PAGE_LAYOUT' , ROOT_DIR.'tpl/layout/');
define( 'DIR_MODULE' , ROOT_DIR.'module/');
define( 'DIR_TPL' , ROOT_DIR.'tpl/');
define( 'DIR_UPLOAD_FILE', STATIC_DIR . 'upload/pics/' );
define( 'DIR_AVATAR', STATIC_DIR . 'upload/avatar/' );
define( 'DIR_IMAGE', STATIC_DIR . 'image/' );

// Logical file path definition
//define all static resource related constant
//define('EDP_DOMAIN',  'http://' . $_SERVER['SERVER_ADDR'] . '/huakaili/' );
//define('STATIC_DOMAIN',  'http://' . $_SERVER['SERVER_ADDR'] . '/huakaili/static/' );
define('EDP_DOMAIN',  'http://www.huakaili.com/' );
define('STATIC_DOMAIN',  'http://static.huakaili.com/' );

define('JS_DIR', STATIC_DOMAIN . 'js/');
define('IMAGE_DIR', STATIC_DOMAIN .'image/');
define('FLASH_DIR', STATIC_DOMAIN .'flash/');

define('UPLOAD_DIR', STATIC_DOMAIN . 'upload/');
define('UPLOAD_PIC_DIR', STATIC_DOMAIN . 'upload/pics/');
define( 'UPLOAD_AVATAR_DIR', STATIC_DOMAIN.'upload/avatar/');
define('CSS_DIR', STATIC_DOMAIN . 'css/');
define( 'DEFAULT_AVATAR_URL', STATIC_DOMAIN . 'image/avatar.gif' );
define( 'UPLOAD_COUPON_DIR', STATIC_DOMAIN.'upload/giftcoupon/');
define(	'DEFAULT_COUPON_URL', STATIC_DOMAIN.'upload/giftcoupon/coupon.gif' );

define( 'GIFT_COUPON_PIC_DIR', STATIC_DIR . 'upload/giftcoupon/');
define( 'GIFT_COUPON_PIC_URL', STATIC_DOMAIN . 'upload/giftcoupon/');

define( 'IS_ADMIN_FLAG', true );

//Encodint setting
define('LOCAL_ENCODING','utf-8');

/**
 * Search type define
 */
define( 'DB_QUERY', '' );
define( 'NORMAL_QUERY', 'Query' );
define( 'SORT_QUERY', 'SortQuery' );
define( 'FILTER_QUERY', 'MultiFilterQuery' );
define( 'FILTER_SORT_QUERY', 'MultiFilterAndSortQuery' );
define( 'RANGE_FILTER_SORT_QUERY', 'MultiRangeFilterAndSortQuery' );
define( 'MAX_REVIEW_CONTENT', 4000 );
define( 'PIC_PER_PAGE', 8 );
define( 'PIC_PER_LINE', 4 );
define( 'MAIL_PER_PAGE', 15 );
define( 'SMALL_PIC_MAX_WIDTH', 100 );
define( 'SMALL_PIC_MAX_HEIGHT', 100 );
define( 'SMALL_AVATAR_WIDTH', 80 );//change to 80 by bo
define( 'LIST_PER_PAGE', 10 );
define( 'LISTENTRY_PER_PAGE', 10 );
define( 'GIFT_PER_PAGE', 12);
/*
 *	Page return Value 
 */

define( 'ILLEGAL_ACCESS', 1 );
define( 'INVALID_PARA', 2 );
define( 'VALIDATION_OK', 0 );

define( 'ABORT_EXECUTE', 1 );
define( 'CONTINUE_EXECUTE', 0 );

/*
 * log file and history log file path
 */
define('DB_LOG_FILE_PATH', ROOT_DIR."logs/db/");
define('DB_LOG_HISTORY_FILE_PATH', ROOT_DIR."logs/history/db/");
define('LOG_FILE_PATH', ROOT_DIR."logs/common/");
define('LOG_HISTORY_FILE_PATH', ROOT_DIR."logs/history/common/");

define( 'WARTER_LOGO_PATH', DIR_IMAGE . 'water.png' );


// weibo constant
define( "WB_AKEY" , '1618127668' );
define( "WB_SKEY" , '5c5bafba0283659bb50b43c1dbe688ad' );
define( "WB_CALLBACK_URL" , 'http://www.huakaili.com/sina_login_callback/' );
?>
